<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>amCharts examples</title> 
        <link rel="stylesheet" href="style.css" type="text/css">
        <script src="../../amcharts/javascript/amcharts.js" type="text/javascript"></script>
        <script src="../../amcharts/javascript/raphael.js" type="text/javascript"></script>        
        
        <script type="text/javascript">
        
            var chart;
            
            var chartData = [{date:new Date(2009,10,2),value:11,value2:2},
                            {date:new Date(2009,10,3),value:15,value2:3},
                            {date:new Date(2009,10,4),value:13,value2:2},
                            {date:new Date(2009,10,5),value:17,value2:1},
                            {date:new Date(2009,10,6),value:15,value2:1},
                            {date:new Date(2009,10,9),value:19,value2:2},
                            {date:new Date(2009,10,10),value:21,value2:2},
                            {date:new Date(2009,10,11),value:20,value2:2},
                            {date:new Date(2009,10,12),value:20,value2:3},
                            {date:new Date(2009,10,13),value:19,value2:4},
                            {date:new Date(2009,10,16),value:25,value2:3},
                            {date:new Date(2009,10,17),value:24,value2:2},
                            {date:new Date(2009,10,18),value:26,value2:2},
                            {date:new Date(2009,10,19),value:27,value2:1},
                            {date:new Date(2009,10,20),value:25,value2:3},
                            {date:new Date(2009,10,23),value:29,value2:4},
                            {date:new Date(2009,10,24),value:28,value2:2},
                            {date:new Date(2009,10,25),value:30,value2:4},
                            {date:new Date(2009,10,26),value:32,value2:3},
                            {date:new Date(2009,10,27),value:33,value2:3},
                            {date:new Date(2009,10,30),value:31,value2:3},
                            {date:new Date(2009,11,1),value:30,value2:2},
                            {date:new Date(2009,11,2),value:29,value2:1},
                            {date:new Date(2009,11,3),value:27,value2:1},
                            {date:new Date(2009,11,4),value:26,value2:1}];
            
            function zoom()
            {
                var count = chartData.length;
                chart.zoomToIndexes(count - 5, count - 1);
            }
            
            window.onload = function()
            {
                chart = new AmCharts.AmSerialChart();
                chart.pathToImages = "../../amcharts/javascript/images/";
                chart.panEventsEnabled = true; // this line is for touch devices only
                chart.addListener("dataUpdated", zoom);
                chart.marginLeft = 50;
                chart.marginRight = 50;
                chart.dataProvider = chartData;
                chart.categoryField = "date";
                
                chart.categoryAxis.parseDates = true;
                chart.categoryAxis.minPeriod = "DD";
                
                var valAxis = new AmCharts.ValueAxis();
                valAxis.stackType = "regular";
                chart.addValueAxis(valAxis);
                
                var graph1 = new AmCharts.AmGraph();
                graph1.valueField = "value";
                graph1.type = "column";
                graph1.fillAlphas = 1;
                graph1.lineColor = "#D8E63C";
                chart.addGraph(graph1);
                
                var graph2 = new AmCharts.AmGraph();
                graph2.valueField = "value2";
                graph2.type = "column";
                graph2.fillAlphas = 1;
                graph2.lineColor = "#E1CE4F";
                chart.addGraph(graph2);
                
                var chartCursor = new AmCharts.ChartCursor();
                chart.addChartCursor(chartCursor);
                
                var chartScrollbar = new AmCharts.ChartScrollbar();
                chartScrollbar.graph = graph1;
                chart.addChartScrollbar(chartScrollbar);
                
                chart.write("chartdiv");
            }
                    
        
        </script>
        
    </head>
    
    <body>
        <div id="chartdiv" style="width:600px; height:400px;"></div>
    </body>
</html>
